package library.domain;

import java.util.ArrayList;

public class Member {
	private String memberId; 
	private String memberPassword;
	private String memberName;
	private String registerNo1;
	private String registerNo2;
	private String phone;
	private String address;
	private ArrayList<Book> books;
	
	public Member(){}
	public Member(String memberId, String memberPassword, String memberName,
			String registerNo1, String registerNo2, String phone, String address) {
		super();
		this.memberId = memberId;
		this.memberPassword = memberPassword;
		this.memberName = memberName;
		this.registerNo1 = registerNo1;
		this.registerNo2 = registerNo2;
		this.phone = phone;
		this.address = address;
	}
	public Member(String memberId, String memberPassword, String memberName,
			String registerNo1, String registerNo2, String phone,
			String address, ArrayList<Book> books) {
		super();
		this.memberId = memberId;
		this.memberPassword = memberPassword;
		this.memberName = memberName;
		this.registerNo1 = registerNo1;
		this.registerNo2 = registerNo2;
		this.phone = phone;
		this.address = address;
		this.books = books;
	}
	public String getMemberId() {
		return memberId;
	}
	public void setMemberId(String memberId) {
		this.memberId = memberId;
	}
	public String getMemberPassword() {
		return memberPassword;
	}
	public void setMemberPassword(String memberPassword) {
		this.memberPassword = memberPassword;
	}
	public String getMemberName() {
		return memberName;
	}
	public void setMemberName(String memberName) {
		this.memberName = memberName;
	}
	public String getRegisterNo1() {
		return registerNo1;
	}
	public void setRegisterNo1(String registerNo1) {
		this.registerNo1 = registerNo1;
	}
	public String getRegisterNo2() {
		return registerNo2;
	}
	public void setRegisterNo2(String registerNo2) {
		this.registerNo2 = registerNo2;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public ArrayList<Book> getBooks() {
		return books;
	}
	public void setBooks(ArrayList<Book> books) {
		this.books = books;
	}
	@Override
	public String toString() {
		return "Member [memberId=" + memberId + ", memberPassword="
				+ memberPassword + ", memberName=" + memberName
				+ ", registerNo1=" + registerNo1 + ", registerNo2="
				+ registerNo2 + ", phone=" + phone + ", address=" + address
				+ ", books=" + books + "]";
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((address == null) ? 0 : address.hashCode());
		result = prime * result + ((books == null) ? 0 : books.hashCode());
		result = prime * result
				+ ((memberId == null) ? 0 : memberId.hashCode());
		result = prime * result
				+ ((memberName == null) ? 0 : memberName.hashCode());
		result = prime * result
				+ ((memberPassword == null) ? 0 : memberPassword.hashCode());
		result = prime * result + ((phone == null) ? 0 : phone.hashCode());
		result = prime * result
				+ ((registerNo1 == null) ? 0 : registerNo1.hashCode());
		result = prime * result
				+ ((registerNo2 == null) ? 0 : registerNo2.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Member other = (Member) obj;
		if (address == null) {
			if (other.address != null)
				return false;
		} else if (!address.equals(other.address))
			return false;
		if (books == null) {
			if (other.books != null)
				return false;
		} else if (!books.equals(other.books))
			return false;
		if (memberId == null) {
			if (other.memberId != null)
				return false;
		} else if (!memberId.equals(other.memberId))
			return false;
		if (memberName == null) {
			if (other.memberName != null)
				return false;
		} else if (!memberName.equals(other.memberName))
			return false;
		if (memberPassword == null) {
			if (other.memberPassword != null)
				return false;
		} else if (!memberPassword.equals(other.memberPassword))
			return false;
		if (phone == null) {
			if (other.phone != null)
				return false;
		} else if (!phone.equals(other.phone))
			return false;
		if (registerNo1 == null) {
			if (other.registerNo1 != null)
				return false;
		} else if (!registerNo1.equals(other.registerNo1))
			return false;
		if (registerNo2 == null) {
			if (other.registerNo2 != null)
				return false;
		} else if (!registerNo2.equals(other.registerNo2))
			return false;
		return true;
	}
	
	
	
}
